package com.eleven.mall.config;

import com.eleven.mall.interceptor.AuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Auther: Rui_simple
 * @Date: 2022/10/21 11:21
 * @Description: JwtInterceptorConfig
 * @Version 1.0.0
 */
@Configuration
public class JwtInterceptorConfig implements WebMvcConfigurer {
    @Autowired
    AuthInterceptor authInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns("/login");
    }

  /*  @Bean
    public AuthInterceptor getJwtInterceptor(){
        return new AuthInterceptor();
    }*/
}
